package com.ncsc.lmis.model;

// Generated Feb 25, 2014 11:44:39 PM by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
//import org.hibernate.annotations.GenericGenerator;
//import org.hibernate.annotations.Parameter;
import javax.persistence.CascadeType;

/**
 * SaleLoanContractReInfo generated by hbm2java
 */
@Entity
@Table(name = "sale_loan_contract_re_info"
      , catalog = "lmis")
public class SaleLoanContractReInfo implements java.io.Serializable
{

   private long contractRecNo;
   private SaleLoanContract saleLoanContract;
   private BigDecimal rePrincipalRemainVal;
   private BigDecimal reCloseBfEndtermInterestVal;
   private BigDecimal rePayExceedVal;

   public SaleLoanContractReInfo()
   {
   }

   public SaleLoanContractReInfo(SaleLoanContract saleLoanContract, BigDecimal rePrincipalRemainVal, BigDecimal reCloseBfEndtermInterestVal, BigDecimal rePayExceedVal)
   {
      this.saleLoanContract = saleLoanContract;
      this.rePrincipalRemainVal = rePrincipalRemainVal;
      this.reCloseBfEndtermInterestVal = reCloseBfEndtermInterestVal;
      this.rePayExceedVal = rePayExceedVal;
   }

   //@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "saleLoanContract"))
   //@Id
   //@GeneratedValue(generator = "generator")
   //@Column(name = "CONTRACT_REC_NO", unique = true, nullable = false)
   @Id
   @Column(name = "CONTRACT_REC_NO", unique = true, nullable = false)
   public long getContractRecNo()
   {
      return this.contractRecNo;
   }

   public void setContractRecNo(long contractRecNo)
   {
      this.contractRecNo = contractRecNo;
   }

   @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
   @PrimaryKeyJoinColumn
   public SaleLoanContract getSaleLoanContract()
   {
      return this.saleLoanContract;
   }

   public void setSaleLoanContract(SaleLoanContract saleLoanContract)
   {
      this.saleLoanContract = saleLoanContract;
   }

   @Column(name = "RE_PRINCIPAL_REMAIN_VAL", nullable = false, precision = 15)
   public BigDecimal getRePrincipalRemainVal()
   {
      return this.rePrincipalRemainVal;
   }

   public void setRePrincipalRemainVal(BigDecimal rePrincipalRemainVal)
   {
      this.rePrincipalRemainVal = rePrincipalRemainVal;
   }

   @Column(name = "RE_CLOSE_BF_ENDTERM_INTEREST_VAL", nullable = false, precision = 15)
   public BigDecimal getReCloseBfEndtermInterestVal()
   {
      return this.reCloseBfEndtermInterestVal;
   }

   public void setReCloseBfEndtermInterestVal(BigDecimal reCloseBfEndtermInterestVal)
   {
      this.reCloseBfEndtermInterestVal = reCloseBfEndtermInterestVal;
   }

   @Column(name = "RE_PAY_EXCEED_VAL", nullable = false, precision = 15)
   public BigDecimal getRePayExceedVal()
   {
      return this.rePayExceedVal;
   }

   public void setRePayExceedVal(BigDecimal rePayExceedVal)
   {
      this.rePayExceedVal = rePayExceedVal;
   }

   public void newSaleLoanContract()
   {
      this.saleLoanContract = new SaleLoanContract();
   }

}
